package cn.dankal.basiclib.rx;


import cn.dankal.basiclib.exception.LocalException;
import cn.dankal.business.pojo.FgResponse;
import io.reactivex.functions.Function;

public class HttpResultFunc<T> implements Function<FgResponse<T>, T> {


    @Override
    public T apply(FgResponse<T> tFgResponse) throws Exception {
        if (tFgResponse.getCode()!=200) {
            throw new LocalException(tFgResponse.getMsg());
        }
        return tFgResponse.getData();
    }



}
